﻿using System;
using System.Windows.Controls;
using System.Windows.Navigation;

namespace MetroApp.Web.Navigation
{
    public class NavigationServiceEx
    {
        private readonly Frame _frame = new Frame { NavigationUIVisibility = NavigationUIVisibility.Hidden };

        public Frame Frame => _frame;

        public bool CanGoBack => _frame.CanGoBack;

        public event NavigatedEventHandler Navigated
        {
            add => _frame.Navigated += value;
            remove => _frame.Navigated -= value;
        }

        public void Navigate(Uri source) => _frame.Navigate(source);
        public void GoBack() => _frame.GoBack();
    }
}
